#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#include <stdio.h>
#include <stdlib.h>

int m,n;
void fileopen(char *filename);
void fileclose();
void main(int argc,char *argv[])
{
  char temp;
  int count1,count2;
  count2=0;
  count1=atoi(argv[1]);
  fileopen(argv[2]);
  while(read(m,&temp,1)!=0)
  {
    if(temp=='\n')
    {
      count2++;
    }
  }
  //printf("count2=%d\n",count2);
  count2=count2-count1;
  count1=0;
  fileclose;
  fileopen(argv[2]);
  while(read(m,&temp,1)!=0)
  {
    if(temp=='\n')
    {
      count1++;
    }
    //printf("count1=%d\n",count1);
    if(count1>=count2)
    {
      printf("%c",temp);
    }
  }
  printf("\n");
  fileclose;
}
void fileopen(char *filename)
{
  m=open(filename,O_RDONLY,0);
  if(m==-1)
  {
    printf("file open faild!\n");
  }
}

void fileclose()
{
  n=close(m);
  if(n==-1)
  {
    printf("file close faild!\n");
  }
}


